#include "creditsdialog.h"

CreditsDialog::CreditsDialog(const wxString&title) : wxDialog(NULL,wxID_ANY,title,wxDefaultPosition,wxSize(700,500))
{
    wxImage::AddHandler(new wxPNGHandler);
    wxBitmap teamfoto(wxT("source\\flower.png"),wxBITMAP_TYPE_PNG);
    creditspd = new wxPanel(this,-1);
    creditspd->SetBackgroundBitmap(teamfoto);

    wxString creditsstring = wxT("Program ini merupakan ");
    creditsst = new wxStaticText(this,wxID_ANY,creditsstring,wxDefaultPosition,wxDefaultSize,wxTE_MULTILINE);

    creditsokbtn = new wxButton(this,wxID_ANY,wxT("Ok"),wxDefaultPosition,wxSize(70,30));
    Connect(wxEVT_COMMAND_BUTTON_CLICKED,wxCommandEventHandler(CreditsDialog::OnQuit));
    wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL);


    vbox->Add(creditspd,3,wxEXPAND|wxALL|wxTOP|wxBOTTOM,5);
    vbox->Add(-1,30);
    vbox->Add(creditsst,1,wxCENTRE,5);
    vbox->Add(-1,30);
    vbox->Add(-1,30);
    vbox->Add(-1,30);
    vbox->Add(creditsokbtn,0,wxALIGN_CENTER|wxTOP|wxBOTTOM,10);

    SetSizer(vbox);
    Centre();
    ShowModal();
}

void CreditsDialog::OnQuit(wxCommandEvent&event)
{
    Destroy();
}
